package com.zhouxiaoge.模板模式;

/**
 * @author 周小哥 gqzmy@163.com 2023/3/21 17:29
 */

public class HummerModelH2 extends HummerModel {

    // 是否需要喇叭响
    private boolean alarmFlag = true;

    @Override
    protected void start() {
        System.out.println("悍马H2~~~启动");
    }

    @Override
    protected void end() {
        System.out.println("悍马H2~~~停止");
    }

    @Override
    protected void alarm() {
        System.out.println("悍马H2~~~鸣笛");
    }

    @Override
    protected void engineBoom() {
        System.out.println("悍马H2~~~发动机轰鸣");
    }

    @Override
    protected boolean isAlarm() {
        return this.alarmFlag;
    }

    public void setAlarmFlag(boolean alarmFlag) {
        this.alarmFlag = alarmFlag;
    }
}
